<?php namespace Phpcmf\Controllers;

/**
 * 二次开发时可以修改本文件，不影响升级覆盖
 */

class Home extends \Phpcmf\Home\Module
{

	public function index() {
		$uid = \Phpcmf\Service::L('input')->get('uid');
		$data = dr_member_info($uid);
		if(!$data) {
			$this->_json('0', '用户不存在');
		}
		// 统计关注人数量
		$guanzhu = \Phpcmf\Service::M()->db->table('member_guanzhu')->where('touid', $uid)->countAllResults();
		// 统计发布帖子数量
		$tiezi = \Phpcmf\Service::M()->db->table('1_quan_form_quantie')->where('uid', $uid)->countAllResults();
		// 统计点赞数量
		$dianzan = \Phpcmf\Service::M()->db->table('1_quan_form_quantie_dianzan')->where('touid', $uid)->countAllResults();
		// 圈子统计
		$quanzi = \Phpcmf\Service::M()->db->table('1_quan')->where('uid', $uid)->countAllResults();
		// 收藏统计
		$shoucang = \Phpcmf\Service::M()->db->table('1_quan_form_quantie_shoucang')->where('uid', $uid)->countAllResults();
		// 短信
		$duanxin = \Phpcmf\Service::M()->db->table('1_duixin')->where('uid', $uid)->countAllResults();
		//评论
		$pinglun = \Phpcmf\Service::M()->db->table('1_quan_form_quantie_comment')->where('uid', $uid)->countAllResults();
		$data['dianzan'] = $dianzan;
		$data['guanzhu'] = $guanzhu;
		$data['tiezi'] = $tiezi;
		$u = [
			'u' => $data,
			'wo' => $this->member,
			'guanzhu' => $guanzhu,
			'tiezi' => $tiezi,
			'dianzan' => $dianzan,
			'quanzi' => $quanzi,
			'shoucang' => $shoucang,
			'duanxin' => $duanxin,
			'pinglun' => $pinglun,
			
		];

		$this->_json('1', '读取成功', $u);
	}

}
